<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="../common/header.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="ctx" value="${pageContext.request.contextPath }"></c:set>
<!-- 晨考成绩查询页面开始 -->
<script type="text/javascript"
		src="${pageContext.request.contextPath}/statics/js/jquery.min.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$("#hide").click(function() {
			$("#p1").hide();
		});
		$("#show").click(function() {
			$("#p1").show();
		});
	});

	function confirmAct(){
		if(confirm('确定要执行删除操作吗?')){
			return true;
		}
		return false;
	}

</script>
<style>
	.p {
		background-color: #C5E2D0;
		height: 200px;
		display: none;
		border-radius: 10px;
	}
</style>
<div class="col-md-12 col-sm-12 col-xs-12">
	<div class="x_panel">
		<h2>晨考成绩查询</h2>
		<div class="x_content">
			<br />
			<form id="query" data-parsley-validate
				  class="form-horizontal form-label-left" method="post"
				  action="${ctx}/MorningResultServlet.do">
				<input type="hidden" name="param" value="cha" />
				<input type="hidden" name="pageIndex" value="1" />
				<ul style="list-style: none;">
					<li><label class="control-label col-md-3 col-sm-3 col-xs-12"
					>培训专业： </label>
						<div class="col-md-6 col-sm-6 col-xs-12">
							<select name="major" value="" id="major"
									class="form-control col-md-7 col-xs-12">
								<option value="">---请选择---</option>
								<c:forEach var="maj" items="${majors }">
									<option value="${maj.major}" ${major==maj.major?'selected':''}>${maj.major}</option>
								</c:forEach>
							</select>
						</div></li>
					<li>
						<div class="form-group">
							<label class="control-label col-md-3 col-sm-3 col-xs-12"
							>班级： </label>
							<div class="col-md-6 col-sm-6 col-xs-12">
								<select name="classname" id="classname" value=""
										class="form-control col-md-7 col-xs-12">
									<option value="">---请选择---</option>
									<c:forEach var="cla" items="${ classes }">
										<option value="${cla.className}" ${classname==cla.className?'selected':''}>${cla.className}</option>
									</c:forEach>
								</select>
							</div>
						</div>
					</li>
					<li>
						<div class="form-group">
							<label class="control-label col-md-3 col-sm-3 col-xs-12">姓名：
							</label>
							<div class="col-md-6 col-sm-6 col-xs-12">
								<input type="text" name="namec" value="${name==null?'':name}"
									   class="form-control col-md-7 col-xs-12">
							</div>
						</div>
					</li>
					<li>
						<div class="form-group">
							<label class="control-label col-md-3 col-sm-3 col-xs-12"
							>考试日期: </label>
							<div class="col-md-6 col-sm-6 col-xs-12">
								<input type="date" name="date" value="${date==null?'':date }" class="form-control col-md-7 col-xs-12">
							</div>
						</div>
					</li>
					<li>
						<div class="form-group">
							<label class="control-label col-md-3 col-sm-3 col-xs-12"
							>成绩表现： </label>
							<div class="col-md-6 col-sm-6 col-xs-12">
								<select name="result" id="result" value=""
										class="form-control col-md-7 col-xs-12">
									<option value="">---请选择---</option>
									<c:forEach var="res" items="${ results }">
										<option value="${res.studentResult}" ${result==res.studentResult?'selected':''}>${res.studentResult}</option>
									</c:forEach>
								</select>
							</div>

						</div>
					</li>
					<li>
						<div class="form-group">
							<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
								<button type="submit" class="btn btn-primary"
										class="btn btn-success">查&nbsp;&nbsp;&nbsp;&nbsp;询</button>
								<a href="${ctx}/MorningResultServlet.do?param=excel" class="btn btn-primary"
								   class="btn btn-success">导&nbsp;&nbsp;&nbsp;&nbsp;出</a>
							</div>
						</div>
					</li>
				</ul>
			</form>
		</div>
	</div>
	<!-- 第二个面板开始 -->
	<div id="p1" class="p" class="x_panel" id="exportPanel">

		<button id="hide" class="btn btn-success btn-sm"
				style="margin-left: 1100px; margin-top: 20px;">关闭</button>

		<div class="x_content">
			<br />
			<form id="demo-form2" data-parsley-validate
				  class="form-horizontal form-label-left" method="post"
				  action="${ctx }/excelweekservlet2">
				<ul style="list-style: none;">
					<li><label class="control-label col-md-3 col-sm-3 col-xs-12"
					>培训专业： </label>
						<div class="col-md-6 col-sm-6 col-xs-12">
							<select name="Emajor" value="" id="Emajor"
									class="form-control col-md-7 col-xs-12">
								<option value="">---请选择---</option>
								<c:forEach var="maj" items="${majors }">
									<option value="${maj.major}" ${Emajor==maj.major?'selected':''}>${maj.major}</option>
								</c:forEach>
							</select>
						</div></li>
					<li>
						<div class="form-group">
							<label class="control-label col-md-3 col-sm-3 col-xs-12"
							>班级： </label>
							<div class="col-md-6 col-sm-6 col-xs-12">
								<select name="Eclassname"  value="" id="Eclassname"
										class="form-control col-md-7 col-xs-12">
									<option value="">---请选择---</option>
									<c:forEach var="clist" items="${cList }">
										<option value="${clist.className}"
											${Eclassname==clist.className?'selected':''}>${clist.className}</option>
									</c:forEach>
								</select>
							</div>
						</div>
					</li>
					<li>
						<div class="form-group">
							<label class="control-label col-md-3 col-sm-3 col-xs-12"
							>考试月份: </label>
							<div class="col-md-6 col-sm-6 col-xs-12">
								<input type="month" name="month" value="${month==null?'':month}"
									   id="querySoftWareName" class="form-control col-md-7 col-xs-12">
							</div>
						</div>
					</li>
					<li>
						<div class="form-group">
							<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
								<button type="submit" class="btn btn-primary"
										class="btn btn-success">导&nbsp;&nbsp;&nbsp;&nbsp;出</button>
							</div>
						</div>
					</li>
				</ul>
			</form>
		</div>
	</div>
	<!-- 第二个面板结束 -->
	<!-- 表格 -->
	<c:if test="${! empty morningResultList}">
		<div class="col-md-12 col-sm-12 col-xs-12">
			<div class="x_panel">
				<button id="show" class="btn btn-success btn-sm">按月份导出班级学生周考成绩信息</button>
				<table id="datatable" class="table table-striped table-bordered">
					<thead>
					<tr>
						<th>考试ID</th>
						<th>学生姓名</th>
						<th>考试日期</th>
						<th>考试类型</th>
						<th>成绩</th>
						<th style="width: 125px;">操作</th>
					</tr>
					</thead>
					<c:forEach var="stu" items="${ morningResultList }">
						<tbody>
						<tr>
							<td>${stu.id }</td>
							<td>${stu.stuName }</td>
							<td>${stu.examDate }</td>
							<td>${stu.examType }</td>
							<td>${stu.stuResult }</td>
							<td>
								<div class="btn-group">
									<button type="button" class="btn btn-danger">点击操作</button>
									<button type="button" class="btn btn-danger dropdown-toggle"
											data-toggle="dropdown" aria-expanded="false">
										<span class="caret"></span> <span class="sr-only">Toggle
											Dropdown</span>
									</button>
									<ul class="dropdown-menu" role="menu">
										<li><a
												href="${ctx}/report/reportmorningedit.jsp?id=${ stu.id }&examtype=${stu.examType}&stuResult=${ stu.stuResult }
											&studentName=${stu.stuName}&examdate=${stu.examDate}"
												data-toggle="tooltip" data-placement="top"
												data-original-title="修改学生信息">修改</a></li>
										<li><a href="${ctx}//MorningResultServlet.do?param=delete&&id=${ stu.id }"
											   data-toggle="tooltip" data-placement="top"
											   data-original-title="删除学生信息" onclick="return confirmAct();">删除</a></li>
									</ul>
								</div>
							</td>
						</tr>
						</tbody>
					</c:forEach>
					<tr>
						<td colspan="10" style="text-align: right;"><span>共有${pages.totalCount }条数据，${pages.currentPageNo }/${pages.totalPageCount }页</span>
							<a href="javascript:page_nav(document.forms[0],1);">首页</a>&nbsp;
							<a href="javascript:page_nav(document.forms[0],${pages.currentPageNo}-1);">上一页</a>&nbsp;
							<a href="javascript:page_nav(document.forms[0],${pages.currentPageNo}+1);">下一页</a>&nbsp;
							<a href="javascript:page_nav(document.forms[0],${pages.totalPageCount});">末页</a>&nbsp;
						</td>
					</tr>
				</table>
			</div>
		</div>
	</c:if>

	<c:if test="${ empty morningResultList }">
		<h1>没有学生信息</h1>
	</c:if>
	<!-- 表格 -->
	<!-- 分页 -->
	<!-- 分页 -->
</div>

<!-- appInfoList页面结束 -->
<!-- /page content -->
<%@ include file="../common/footer.jsp"%>

<script src="${ctx }/statics/localjs/report.js"></script>
<script src="${ctx }/statics/localjs/morningResult.js"></script>


<script src="${pageContext.request.contextPath }/statics/localjs/exportMoringResult.js"></script>